<template>
    <div>
        <h1>Vue Router Demo</h1>
        <button @click="backHistory">后退</button>
        <button @click="forwardHistory">前进</button>
        <button @click="goHistory">用go后退2步</button>
    </div>
</template>
<script>
import Vue from 'vue';
export default Vue.extend({
    name: 'Banner',
    methods: {
        backHistory() {
            this.$router.back()
        },
        forwardHistory() {
            this.$router.forward()
        },
        goHistory() {
            this.$router.go(-2) // 接收一个整数
        }
    },
}) 
</script>